import Vue from 'vue';
import router from '../common/router';
import http from '../common/http';
import config from '../common/config';
import common from '../common/common';
import Const from "../common/const";
import util from '../common/util';
import App from './App.vue';
import RouterTab from 'vue-router-tab';
import ViewUI from 'view-design';
import message from '../common/message.js';
import store from "../common/store.js";
import dict from '../common/dict';
import sse from '../common/sse';
import 'vue-router-tab/dist/lib/vue-router-tab.css';
import 'view-design/dist/styles/iview.css';
import './assets/bootstrap.min.css';
import './assets/animate.min.css';

import dataV from '@jiaminghi/data-view';
import './assets/main.css';



Vue.use(dataV);
Vue.use(ViewUI);
Vue.use(RouterTab);
Vue.prototype.http = http;
Vue.prototype.sse = sse;
Vue.prototype.config = config;
Vue.prototype.common = common;
Vue.prototype.util = util;
Vue.prototype.message = message;
Vue.prototype.store = store;
Vue.prototype.CONST = Const;
Vue.prototype.dict = dict;

import pView from "./components/p-view";
Vue.component('p-view', pView);

import permissionTree from "./components/permission-tree";
Vue.component('permission-tree', permissionTree);

import permissionSelected from "./components/permission-selected";
Vue.component('permission-selected', permissionSelected);

import fileUpload from "./components/file-upload";
Vue.component('file-upload', fileUpload);

if (process.env.NODE_ENV === "local") {
	require('../common/mock.js');
}

for(let name in router.options.detailRouters) {
	let detailItem = router.options.detailRouters[name];
	Vue.component(detailItem.name, detailItem.component);
}

new Vue({
  render: h => h(App),
  router
}).$mount('#app');